package com.suzhe.ymall.product.vo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.suzhe.ymall.product.param.SpuAttrParam;
import com.suzhe.ymall.product.param.SpuSaleAttrParam;
import com.suzhe.ymall.product.pojo.Sku;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * spu表
 * </p>
 *
 * @author suzhe
 * @since 2019-07-21
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value = "Spu对象", description = "spu表")
public class SpuVo implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "spu id")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "标题")
    private String title;

    @ApiModelProperty(value = "1级类目id")
    private Long cid1;

    @ApiModelProperty(value = "2级类目id")
    private Long cid2;

    @ApiModelProperty(value = "3级类目id")
    private Long cid3;

    @ApiModelProperty(value = "类目名")
    private String cname;

    @ApiModelProperty(value = "商品所属品牌id")
    private Long brandId;

    @ApiModelProperty(value = "spu展示图")
    @JsonIgnore
    private String showImg;

    @ApiModelProperty(value = "是否在售：0 否，1 是")
    private Boolean saleable;

    @JsonIgnore
    @TableLogic
    private Boolean deleted;

    @ApiModelProperty(value = "创建者")
    private Long creater;

    @ApiModelProperty(value = "更新者")
    private Long updater;

    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    @ApiModelProperty(value = "修改时间")
    private Date updateTime;

    @TableField(exist = false)
    List<Sku> skus;

    @TableField(exist = false)
    @ApiModelProperty(value = "商品描述")
    private String  description;

    @TableField(exist = false)
    @ApiModelProperty(value = "包装清单")
    private String  packingList;

    @TableField(exist = false)
    @ApiModelProperty(value = "属性")
    private List<SpuAttrParam> attr;


    @TableField(exist = false)
    @ApiModelProperty(value = "销售属性")
    private List<SpuSaleAttrParam> saleAttr;

    @TableField(exist = false)
    @ApiModelProperty(value = "spu展示图片列表")
    private List<String> showImgList;

    @TableField(exist = false)
    @ApiModelProperty(value = "品牌名")
    private String brandName;


}
